<ui:composition template="/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">
    <ui:define name="title">
        <h:outputText value="#{bundle.CreateCustomerTitle}"></h:outputText>
    </ui:define>
    <ui:define name="body">
        <h:panelGroup id="messagePanel" layout="block">
            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
        </h:panelGroup>
        <h:form>
            <!--<p:panel  header="Formulaire de création de compte" >-->
            <h:outputLabel value="Civilité :" for="civility" />
            <h:inputText id="civility" value="#{customerController.selected.civility}" title="civility" />

            <h:outputLabel value="Nom :" for="firstName" />
            <h:inputText id="firstName" value="#{customerController.selected.firstName}" 
                         title="firstName"    required="true"  
                         requiredMessage="Veuillez remplir de le champ*** Nom ***pour continuer" />
            <p:message for="firstName"/>

            <h:outputLabel value="Prénom :" for="lastName" />
            <h:inputText id="lastName" value="#{customerController.selected.lastName}" 
                         title="lastName" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Prénom ***pour continuer"/>
            <p:message for="lastName"/>

            <h:outputLabel value="Adresse 1 :" for="address1" />
            <h:inputText id="address1" value="#{customerController.selected.address1}" 
                         title="address1" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Adresse 1 ***pour continuer"/>
            <p:message for="address1"/>

            <h:outputLabel value="Adresse 2 :" for="address2" />
            <h:inputText id="address2" value="#{customerController.selected.address2}" title="address2" />
            <h:outputLabel value="Adresse 3 :" for="address3" />
            <h:inputText id="address3" value="#{customerController.selected.address3}" title="address3" />

            <h:outputLabel value="Code postal :" for="zipCode" />
            <h:inputText id="zipCode" value="#{customerController.selected.zipCode}" 
                         title="zipCode" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Code postal ***pour continuer"/>
            <p:message for="zipCode"/>

            <h:outputLabel value="Ville :" for="city" />
            <h:inputText id="city" value="#{customerController.selected.city}" 
                         title="city" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Ville ***pour continuer"/>
            <p:message for="city"/>

            <h:outputLabel value="Pays :" for="country" />
            <h:inputText id="country" value="#{customerController.selected.country}" 
                         title="country" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Pays ***pour continuer" />
            <p:message for="country"/>

            <h:outputLabel value="Téléphone :" for="phone" />
            <h:inputText id="phone" value="#{customerController.selected.phone}" title="phone" />
            <h:outputLabel value="Portable :" for="mobile" />
            <h:inputText id="mobile" value="#{customerController.selected.mobile}" title="mobile" />

            <h:outputLabel value="Email :" for="email" />
            <h:inputText id="email" value="#{customerController.selected.email}" 
                         title="email" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Nom ***pour continuer"/>
            <p:message for="email"/>

            <h:outputLabel value="Login :" for="login" />
            <h:inputText id="login" value="#{customerController.selected.login}" 
                         title="login" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Login ***pour continuer"/>
            <p:message for="login"/>

            <h:outputLabel value="Mot de passe :" for="password" />
            <h:inputText id="password" value="#{customerController.selected.password}" 
                         title="password" required="true" 
                         requiredMessage="Veuillez remplir de le champ*** Mot de passe ***pour continuer"/>
            <p:message for="password"/>
            <!--</p:panel>-->
            <h:panelGrid columns="2" headerClass="toto" >
                <h:commandButton action="#{customerController.create}" value=" Valider " />
                <h:commandButton action="#" value="Retour" immediate="true"/>
            </h:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>

</html>

